package net.xdclass.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

/**
 * 小滴课堂,愿景：让技术不再难学
 *
 * @Description
 * @Author 二当家小D
 * @Remark 有问题直接联系我，源码-笔记-技术交流群
 * @Version 1.0
 **/

public class AlipayConfig {

    public static final String PAY_GATEWAY = "https://openapi.alipaydev.com/gateway.do";

    /**
     * 支付宝 APPID
     */
    public static final  String APPID="2016092000555936";

    /**
     * 应用私钥
     */
    public static final String APP_PRI_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCPULg2k9ugRE3tGQXLTg6Ez7mtpsei9bmHiHomwJ3lxZ19jR6R/BcG9r5UnCDvRl5gKJ4uVAA4Tvf4M+5e3d+0fiC+Mchcg9p5hv1GJvrsmSup3yWFZ4PNKyh0Qdz/yOWNoKo1Ya1IOQ3uIYPz0tpQuBPs3TZjcTsYxVWs6fbChB2Lbo9dxUcFWC7nWOq2ZD9DLa+P0lPMMGOWo41CBumCzn4JrbbQ9cXPdMc33HUO1J9XqRGpmxH1y0idNt9Qcne+QrskMzisBip9YLbdN0hNzJVyqKXBDUVV8OQBPFruD0SDaVf85Ue+k0Moz16LOD6D58tFViL/sLJOElwlFR3vAgMBAAECggEAXl037jfNFOnkpYkkV4k95hUgnUaDjLlfP+6M/5c0YGaOHG0fA+CJCPzOtcdXqDUdTxNvk/Gbc3gLrlIDUlOlSKMDzDfbRY9L+1j2y4o/DiqMpX1Yp05RanZQXLxBV+pfu7FeYWe/QR7QHUvUJmdfeGa8N+owNaoIz3afwwsKf2ia3D+I8tR8/fboeBcvkqLnW5GuM9ISUkDC+tLxWytigmT+n3w+KqEErhbKrJQTTQswvw8H/W362lI8URoZB23FFv1RlqtHVDARlLEnunpWI5dugA8++i0TCvn+dhK7f5e+SYn4wnm8utZYW7I75wOo57lGGwVtyFx7KjRj04R4gQKBgQDzEn0XxHAynKW2EuhC/9Nom3tgZorlIQkX5+gt1cpHG9eR1UMV55oWL9s7ROtbnE0pgCmXl4T3H0sem4n14ZXr0QkrngDro0uULl67j9dmj4uB9FcqDFqhsatTquSJWTSWKZwfIDVfwTqHJu6RTM8qCwWHkk7ALfbxB/VEesV8pQKBgQCW8AGq79HmpJGXZm3zr581A898mG3WrPBORYZuDT2xORLSvVJwFO5v16Eu6DklBWE4dmVU+lIj5qeEQYTLnnidvlHnfdyx17TDRcjEFaTinBjpltIzamYOGC/dsmicOPPAqazvgn+AZ4tO1j8zzDlV5lBihd+P62NbSjKmqcmIAwKBgQCUXGeP1y1oJuaaICY1prIhuizu5QfH3IcRWVIEj+X7ywmjkFh3CTqqaiFUprdE3jzWpMw+I5RbxXTzRJpLQppgKeGABtum96+MzVSzBJPDnL/Y3QtKtemnoarh0X/WOWV4dgM9mEobnPQdQ+z/MLONhNamLe31LNj5uxK/7nOVpQKBgEswXjRP6Uky+8/m16kH+JBJSKfxqu3BEqh7G99guzW4j7bpVtK8qpaOXR3n0uetSWP+HrZ5SEfYE+TfWo6wb7ds4pIl8bWqFcMc1UlQ2uWECyj519aDDznANMAEqvX/rPVx0NMzN964Nf5c3fkop/sxkyOxOtAP21vTl23MsLcPAoGBAMIQXMp1+6NEEbgcW9P1oG/SdDgOYm4yp8LVtjsdPk7hKqhgdO6ip+LOSBs28vQqJTsi8hgHlMTnR1IarbBrcTP91Sar9DDtu5iOM62lknNtf0+Og5xOkNyNP/E9Gh7zYbQIfhBKS0tAJlwIvfHBJNoRPnaaY+KvluvbVWNxvkcW";

    /**
     * 支付宝公钥
     */
    public static final String ALIPAY_PUB_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk8OPeu/Bhbxr8chgRXnDSm0FDMZoK3r/qLLzqbv+L2/mYTLxHKw5U3c5XPHXar5SVWRp+IgLsZdTfYeZ+jYFmY+dTYk8mG8GXc1uYwHFADcWQAcR4KA3cbxiaubg7g//ECEhwA5CmaosjJ2p8UAz4j7cDB37TDON7oGMFbkXnSBlGhj5oy6rxdUXS+KeG9YmRPkQU3x3ljK37RRLFhwPPRR218IGDCmCtnI5ddKEq1hMAPnYmKNezerxSGGxxIaggt+sDwN1S3GNNSU7AelLPuvNEza49KaQijsBJpaLKUvqt5KO4IVfvPCmRsIFe7KzgdEmjygIY81qXacPzopJIQIDAQAB";


    /**
     * 签名类型
     */
    public static final  String SIGN_TYPE="RSA2";

    private volatile static AlipayClient instance = null;

    /**
     * 字符编码
     */
    public static final  String CHARSET="UTF-8";

    public static final String FORMAT = "json";

    public static AlipayClient getInstance() {
        if (instance == null) {
            synchronized (AlipayConfig.class) {
                if (instance == null) {
                    instance = new DefaultAlipayClient(PAY_GATEWAY, APPID, APP_PRI_KEY, FORMAT, CHARSET, ALIPAY_PUB_KEY, SIGN_TYPE);
                }
            }
        }
        return instance;
    }


    private AlipayConfig(){

    }


}
